package spider.entitys;

import java.io.Serializable;

/**
 * 小说的章节实体
 */
public class Chapter implements Serializable {

    private static final long serialVersionUID = 1952081502449669633L;
    private String title;
    private String url;

    //region set get tostring equals hashcode


    @Override
    public String toString() {
        return "Chapter{" +
                "title='" + title + '\'' +
                ", url='" + url + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Chapter chapter = (Chapter ) o;

        return title.equals(chapter.title) && url.equals(chapter.url);
    }

    @Override
    public int hashCode() {
        int result = title.hashCode();
        result = 31 * result + url.hashCode();
        return result;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }
    //endregion
}
